package com.kfm.base.array;

import java.util.Random;

public class Demo02 {

    public static void main(String[] args) {

        /*
          随机数， 伪随机数
          Random  random.nextInt(value)   [0, value)
          Math.random()  0 ~ 1   [0, 1)
         */
        Random random = new Random();

        // 取 1 ~ 40
        for (int i = 0; i < 10; i ++){
            System.out.println(random.nextInt(40) + 1);
//            System.out.println((int)(Math.random() * 40 + 1));
        }
    }
}
